// TitleBar.tsx
// import { useEffect } from 'react';

export default function TitleBar(): JSX.Element {
  const handleMinimize = () => window.electron.minimize();
  const handleMaximize = () => window.electron.maximize();
  const handleClose = () => window.electron.close();

  return (
    <div className="flex items-center justify-between px-3 py-1 bg-gray-800 text-white select-none drag">
      <div className="flex items-center space-x-3">
        <span className="font-bold">🚀 MyApp</span>
        {/* 这里可以自定义菜单项 */}
        <div className="flex space-x-2 text-sm">
          <button className="hover:underline">File</button>
          <button className="hover:underline">Edit</button>
          <button className="hover:underline">View</button>
        </div>
      </div>
      <div className="flex items-center space-x-2 no-drag">
        <button onClick={handleMinimize}>🗕</button>
        <button onClick={handleMaximize}>🗖</button>
        <button onClick={handleClose}>❌</button>
      </div>
    </div>
  );
}
